A user can simulate one or more virtual machines on one physical computer by using a virtualization technology, and these virtual machines can work like real computers, for example, the user may install an operating system, install an application, access network resources, and so on.
A snapshot technology of a virtual machine is generated at the same time as the virtualization technology, and because computing and storage resources of a virtual machine are virtualized by a virtual machine monitor (VMM), we can reserve a central processing unit (CPU) state, a memory state, and storage data of the virtual machine at a certain time point conveniently by using the snapshot technology, so that complicated backup of all states can be easily implemented on a physical machine, and a user can conveniently back up and recover the virtual machine.
At present, there are mainly two kinds of common snapshot applications: one is simple storage snapshot, where only storage data is backed up; when a virtual machine user uses a virtual machine, a mirror of the virtual machine may be damaged or the virtual machine may fail to be activated normally for various reasons (such as viruses, damage by Trojan, mistaken deletion of a system file, or mistaken formatting), and if related data is backed up by means of the storage snapshot when the virtual machine is normal, page data of a backup point can be conveniently recovered. The other is a combination of storage snapshot and memory snapshot; in some scenarios, a user needs to quickly create or recover a virtual machine (deployment and loading of a related service is complicated and cumbersome, interruption time for service recovery is highly required, and virtual machines are rapidly deployed in batches, and so on), or a current service state needs to be reserved for some debugging requirements (fault locating, test branch selection, and so on), and at this time, using a storage snapshot alone cannot meet the requirements. Therefore, introduction of a memory snapshot compensates for the deficiency in this aspect, and memory data of the virtual machine is stored into a memory snapshot file on an external storage medium by means of a capability of a VMM, thereby facilitating storage and recovery at any time; and in addition, this is also a convenience brought about under a virtualization condition.
Virtual Machine ware (VMWare) is a leading vendor of a virtualization solution, and currently can provide an overall solution for a snapshot of a virtual machine, including a storage snapshot and a memory snapshot. The memory snapshot thereof is full copying of a black box of the memory data, and the size of a generated snapshot file is consistent with a memory specification of a virtual machine, that is, the size of a memory snapshot file finally generated by a virtual machine with 1 gigabyte (G) memory is 1G, and is stored in a distributed storage thereof together with the storage snapshot. When a snapshot is recovered, snapshot files are read in sequence to perform 1:1 memory recovery. Therefore, both a snapshot generation process and a snapshot recovery process take a long time, and in addition, the size of the generated memory snapshot file is consistent with that of the memory of the virtual machine, which also is a waste of storage resources.